<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class MissionDissent extends Model
{
   
	protected $pk = 'id';

    public function userInfo(){
    	return $this->hasone("user",'u_id',"u_id");
    }



    public function getContentAttr($value,$row){
      return $value?htmlspecialchars_decode($value):'';
    }


    /**
     * 获取全部状态
     * @var [type]
     */
    public static function  getStatus($int=0){
      $res =  [
        0=>__('pending'),
        1=>__('processing'),
        2=>__('done'),           
      ];
      return $int>0 ? $res[$int]:$res;
    } 

    /**
     * 获取全部状态
     * @var [type]
     */
    public  function  getStatusTextAttr($value,$row){
    	 return $this->getStatus($row['status']);
    }
}
